package com.ehe.security.feign;

import com.ehe.common.core.constant.AppConstant;
import com.ehe.common.core.constant.SecurityConstants;
import com.ehe.common.core.domain.ResponseInfo;
import com.ehe.system.api.domain.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "principalClient",value = AppConstant.APPLICATION_USER_NAME)
public interface PrincipalClient {


    /**
     * 通过用户名查询用户信息
     * @param username 用户名
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/user/info/{username}")
    ResponseInfo<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
